python="/usr/bin/python2.7"


ratingcvs="/home/lili/project/recommend/pyrcd/rating_cvs.py" #导出rating
lrtzcvs="/home/lili/project/recommend/pyrcd/lrtz_cvs.py" #导出lr的训练数据


itemcf="/home/lili/project/recommend/pyrcd/personal_recommendation/CF/production/itemcf.py"
item2vec="/home/lili/project/recommend/pyrcd/personal_recommendation/Item2Vec/production/run_total.sh"
lfm="/home/lili/project/recommend/pyrcd/personal_recommendation/LFM/production/lfm.py"
personal_rank="/home/lili/project/recommend/pyrcd/personal_recommendation/PR/production/personal_rank.py"

#lr
lr="/home/lili/project/recommend/pyrcd/personal_recommendation/LR/production/run_total.sh"


#导出数据
#导出rating
if [ -f $ratingcvs  ]; then
    $python $ratingcvs
else
    echo "no ratingcvs file"
    exit
fi
 echo "export rating success"

#导出lr的训练数据
if [ -f $lrtzcvs  ]; then
    $python $lrtzcvs
else
    echo "no lrtzcvs file"
    exit
fi
 echo "export lrtzcvs success"




#训练cf模型
if [ -f $itemcf  ]; then
    $python $itemcf
else
    echo "no itemcf file"
    exit
fi

#训练lfm模型
if [ -f $lfm  ]; then
    $python $lfm
else
    echo "no lfm file"
    exit
fi

#训练pr模型
if [ -f $personal_rank  ]; then
    $python $personal_rank
else
    echo "no personal_rank file"
    exit
fi
echo "train personal_rank success"




#训练pr模型
if [ -f $item2vec  ]; then
    source $item2vec
else
    echo "no item2vec file"
    exit
fi
echo "train item2vec success"


#训练lr模型
if [ -f $lr  ]; then
    source $lr
else
    echo "no lr file"
    exit
fi
echo "train lr success"